package util;

import entity.Doctor;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @Author:
 * @Date: 2020-04-16
 * @Description: @PACKAGE:cn.tianbao.util
 * @version: 1.0
 */
public class DoctorRowMapper implements RowMapper<Doctor> {

    @Override
    public Doctor getRow(ResultSet resultSet) {
        Doctor doctor = new Doctor();
        //在结果集里拿数据，进行对象的赋值
        try {
            doctor.setId(resultSet.getString(1));
            doctor.setPwd(resultSet.getString(2));
            doctor.setName(resultSet.getString(3));
            doctor.setTel(resultSet.getString(4));
            doctor.setSex(resultSet.getString(5));
            doctor.setEdu(resultSet.getString(6));
            doctor.setJoindate(resultSet.getString(7));
            doctor.setAdmincheck(resultSet.getString(8));
            doctor.setOther(resultSet.getString(9));
            doctor.setPicture(resultSet.getString(10));
            doctor.setPost(resultSet.getString(11));
            doctor.setEmail(resultSet.getString(12));
        } catch (SQLException e) {
            e.printStackTrace();
        }

        return doctor;
    }
}
